/**
 * amis v6.13.0
 * build time: 2025-08-12
 * Copyright 2018-2025 baidu
 */

'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

var _Shape = require('amis-ui/lib/components/Shape');
var tslib = require('tslib');
var React = require('react');
var amisCore = require('amis-core');
var cx = require('classnames');

function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }

var _Shape__default = /*#__PURE__*/_interopDefaultLegacy(_Shape);
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);

var __react_jsx__ = require('react');
var _J$X_ = (__react_jsx__["default"] || __react_jsx__).createElement;
var _J$F_ = (__react_jsx__["default"] || __react_jsx__).Fragment;


;var ShapeRenderer = /** @class */function (_super) {
  tslib.__extends(ShapeRenderer, _super);
  function ShapeRenderer() {
    return _super !== null && _super.apply(this, arguments) || this;
  }
  ShapeRenderer.prototype.handleClick = function () {
    this.props.dispatchEvent('click', this.props.data);
  };
  ShapeRenderer.prototype.render = function () {
    var _a = this.props,
      className = _a.className,
      radius = _a.radius,
      shapeType = _a.shapeType,
      data = _a.data,
      rest = tslib.__rest(_a, ["className", "radius", "shapeType", "data"]);
    var shapeTypeValue = amisCore.filter(shapeType, data) || shapeType;
    var radiusValue = +amisCore.filter(radius, data) || radius;
    return _J$X_(_Shape__default["default"], tslib.__assign({}, rest, {
      className: cx__default["default"](className),
      shapeType: shapeTypeValue,
      radius: radiusValue,
      onClick: this.handleClick
    }));
  };
  tslib.__decorate([amisCore.autobind, tslib.__metadata("design:type", Function), tslib.__metadata("design:paramtypes", []), tslib.__metadata("design:returntype", void 0)], ShapeRenderer.prototype, "handleClick", null);
  ShapeRenderer = tslib.__decorate([amisCore.Renderer({
    type: 'shape'
  })], ShapeRenderer);
  return ShapeRenderer;
}(React__default["default"].Component);

exports.ShapeRenderer = ShapeRenderer;
